package com.xbts.system.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xbts.system.domain.CnOrderItem;
import com.xbts.system.domain.CnWorkOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 工单Mapper接口
 *
 * @author xbts
 * @date 2023-08-28
 */
public interface CnWorkOrderMapper extends BaseMapper<CnWorkOrder> {

    /**
     * 查询工单列表
     *
     * @param queryWrapper 查询条件
     * @return 工单集合
     */
    @Select("select cwo.order_num, cwo.problem_description, cwo.problem_type, cwo.status, cwo.create_by, cwo.create_time, su.user_name, " +
            " cwo.update_by, cwo.update_time,su.nick_name create_by " +
            "from cn_work_order cwo " +
            "left join sys_user su on cwo.create_by = su.user_id ${ew.customSqlSegment}")
    List<CnWorkOrder> selectCnWorkOrderList(@Param(Constants.WRAPPER) QueryWrapper<CnWorkOrder> queryWrapper);
}
